<!DOCTYPE html>
<html lang="en">
<head>
    {T "mem","head",TPLID}
    <link rel="stylesheet" href="res/mem/css/editContribute.css" media="all">
    <link rel="stylesheet" href="res/libs/dialog/ui-dialog.css" media="all">
    <link rel="stylesheet" href="/res/libs/layuiadmin/style/dtree/dtree.css" media="all">
    <link rel="stylesheet" href="/res/libs/layuiadmin/style/dtree/font/dtreefont.css" media="all">
</head>
<body>
    <!-- 设置投稿内容 -->
    <div id="editContribute" class="wp ">
        <span class="layui-breadcrumb" lay-filter="breadcrumb">
           <!-- <img class="cont-jian home" src="../static/imgs/zhuye.png" alt="">-->
            <!--<a href="javascript:;">我的主页</a>
            <a><cite>二级栏目</cite></a>-->
        </span>
        <form method="post" action="/index.php?m=mem&f=article&v=saveArticleContent">
            <div class="editContribute-content">
                <div class="layui-form-item" style="width: 100%;">
                    <label class="layui-form-label"><font color="red">*</font> 栏目：</label>
                    <div class="layui-input-block" >
                       <url id="selTree" class="dtree" data-id="0"></url>
                    </div>
                </div>
                <div class="layui-form-item" style="    width: 100%;">
                    <label class="layui-form-label"><font color="red">*</font> 标题：</label>
                    <div class="layui-input-block" >
                        <input type="text"  name="form[title]" id="title"  value="{$data['title']}" class="layui-input" style="width: 100%;" datatype="*2-80" nullmsg="请输入标题" errormsg="标题至少2个字符,最多80个字符！" >
                    </div>
                </div>
                {loop $field_list[5] $info}
                <div class="layui-form-item">
                    <label class="layui-form-label">{if $info['star']}<font color="red">*</font>{/if} {$info['name']}：</label>
                    <div class="layui-input-block">{$info['form']} </div>
                </div>
                {/loop}

                {loop $field_list[0] $info}
                <div class="layui-form-item">
                    <label class="layui-form-label">{if $info['star']}<font color="red">*</font>{/if} {$info['name']}：</label>
                    <div class="layui-input-block">{$info['form']} </div>
                </div>
                {/loop}

                <div class="layui-form-item">
                    <label class="layui-form-label"> </label>
                    <input type="submit" name="submit" id="submit" value="提交" class="layui-btn layui-btn-radius _green " style="min-width: 160px;">
                </div>
            </div>
        </form>

    </div>
</body>
<script src="res/js/base.js"></script>
<script src="res/libs/dialog/dialog.js"></script>
<script src="res/libs/dialog/dialog-plus.js"></script>
{T "mem","foot",TPLID}
<script>
    layui.config({
        base: 'res/libs/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index',  'dtree'], function(){
        var $ = layui.$
            ,admin = layui.admin
            ,element = layui.element
            ,router = layui.router()
            ,dtree = layui.dtree;

        element.render();

        element.on('tab(component-tabs-brief)', function(obj){
            layer.msg(obj.index + '：' + this.innerHTML);
        });
        /* Hash地址的定位 */
        var layid = router.hash.replace(/^#layid=/, '');
        layid && element.tabChange('component-tabs-hash', layid);

        element.on('tab(component-tabs-hash)', function(elem){
            if(elem.elem.context.innerText=='我要投稿'){
                window.parent&&window.parent.openDialog();
                return
            }
            location.hash = '/'+ layui.router().path.join('/') + '#layid=' + $(this).attr('lay-id');
        });

        dtree.renderSelect({
                elem: "#selTree",
                url: "/index.php?m=mem&f=article&v=getMyCategory",
                ficon: ["1","7"],
                icon: "-1" ,
               // url: "/res/js/tree.json",
                selectInitVal: "001003", // 你可以在这里指定默认值
                done: function(res, $ul, first){
                    if(first) {
                        dtree.dataInit("selTree", "001003");
                        // 也可以在这里指定，第二个参数如果不填，则会自动返显当前选中的数据
                        var selectParam = dtree.selectVal("selTree");
                    }

                }
            });
    });
</script>
</html>